<div class="row">
    <div class="col-lg-12">
        <ol class="breadcrumb">
            <li><a><i class="fa fa-home mrg-r-sm"></i>首页</a></li>
            <li class="active"><span>合作请求审核</span></li>
        </ol>
    </div>
</div>

<div class="clearfix">
    <div class="filter-block pull-left">
        <div class="form-group pull-left">
            <input type="text" class="form-control"  ng-model="searchNew.userName"  placeholder="请输入姓名">
        </div>
        <div class="form-group pull-left">
            <input type="text" class="form-control"  ng-model="searchNew.telePhone"  placeholder="请输入电话">
        </div>
		<div class="form-group pull-left">
			<select class="form-control" ng-model="searchNew.company"  ng-options=" company1.name as company1.name for company1 in companyList"  >
				<option value="">请选择申请企业</option>
			</select>
		</div>
		<div class="form-group pull-left">
			<select class="form-control" ng-model="searchNew.serviceType1"  ng-click="getserviceType2(searchNew.serviceType1.code)" ng-options=" service1 as service1.title for service1 in serviceList"  >
				<option value="">请选择服务项目</option>
			</select>
		</div>
		<div class="form-group pull-left">
			<select class="form-control"  ng-model="searchNew.serviceType2" ng-click="getserviceType3(searchNew.serviceType2.code)" ng-options=" service2 as service2.title for service2 in serviceList2" >
				<option value="">请选择服务项目</option>
			</select>
		</div>		
		<div class="form-group pull-left">
			<select class="form-control"  ng-model="searchNew.serviceType3"  ng-options=" service3 as service3.title for service3 in serviceList3" >
				<option value="">请选择服务项目</option>
			</select>			
		</div>	
        <!--<div class="form-group pull-left">
            <select class="form-control">
                <option value="">请选择分成</option>
            </select>
        </div>-->
        <a class="btn btn-success pull-left form-group" ng-click="search(searchNew)">
            <span>搜索</span>
        </a>
    </div>
</div>

<!--<div class="row">
    <div class="col-lg-12">
        <div class="main-box no-header clearfix">
            <div class="main-box-body clearfix">
                <div class="table-responsive">
                    正在开发中........
                </div>
            </div>
        </div>
    </div>
</div>-->

<div class="row">
    <div class="col-lg-12">
        <div class="main-box no-header clearfix">
            <div class="main-box-body clearfix">
                <div class="table-responsive">
                    <table class="table user-list table-hover">
                        <thead>
                            <tr>
                                <th >
                                    <span>人员</span>
                                </th>
                                <th class="text-center">
                                    <span>联系电话</span>
                                </th>
                                <th class="text-center">
                                    <span>服务项目</span>
                                </th>
                                <th class="text-center">
                                    <span>申请企业</span>
                                </th>
                                <th class="text-center">
                                    <span>申请时间</span>
                                </th>
                                <th class="text-center">
                                    <span>合作分成比</span>
                                </th>
                                <th class="text-center">
                                    <span>操作</span>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                        	
                        	
                            <tr ng-repeat="item in list"  >
	                            	<td>
						            	<img src="{{URL+item.photo}}" alt=""  class="user_logo" ng-show="item.photo!=''&&item.photo!=null" />
						            	<img src="../../public/img/noimg.jpeg" class="user_logo" alt=""  ng-if="item.photo==''||item.photo==null" />
										<a class="user-link">{{item.to_company_servant_name}}</a>
										<span class="user-subhead">{{item.sex}}</span>
						            </td>
	                                <td class="text-center">{{item.send_company_telephone}}</td>
	                                <td class="text-center">{{item.serviceType3_title}}</td>
	                                <td class="text-center">{{item.send_company_name}}</td>
	                                <td class="text-center">{{item.createTime}}</td>
	                                <td class="text-center">{{item.send_company_salary_rate}}:{{item.to_company_salary_rate}}</td>
	                                <td class="text-center">
	                                    <a href="#/servant/collaborateDetails/{{item.to_company_servant_id}}" class="table-link">
	                                        <span class="fa-stack">
	                                            <i class="fa fa-square fa-stack-2x"></i>
	                                            <i class="fa fa-info fa-stack-1x fa-inverse"></i>
	                                        </span>
	                                    </a>
	                                    <a ng-if="item.status=='0'" ng-click="editStatus(item,1)" class="table-link">
	                                        <span class="fa-stack">
	                                            <i class="fa fa-square fa-stack-2x"></i>
	                                            <i class="fa fa-check fa-stack-1x fa-inverse"></i>
	                                        </span>
	                                    </a>
	                                    <a ng-if="item.status=='0'" ng-click="editStatus(item,2)" class="table-link danger">
	                                        <span class="fa-stack">
	                                            <i class="fa fa-square fa-stack-2x"></i>
	                                            <i class="fa fa-ban fa-stack-1x fa-inverse"></i>
	                                        </span>
	                                    </a>
	                                    <a ng-if="item.status=='1'" href="javascript:void(0);" class="table-link  default">
	                                        <span class="fa-stack">
	                                            <i class="fa fa-square fa-stack-2x"></i>
	                                            <i class="fa fa-check fa-stack-1x fa-inverse"></i>
	                                        </span>
	                                    </a>
	                                    <a ng-if="item.status=='2'"  href="javascript:void(0);" class="table-link default">
	                                        <span class="fa-stack">
	                                            <i class="fa fa-square fa-stack-2x"></i>
	                                            <i class="fa fa-ban fa-stack-1x fa-inverse"></i>
	                                        </span>
	                                    </a>                                   
	                                </td>
					            
                            </tr>
                        </tbody>
                    </table>
                </div>
                <ul class="pagination pull-right">
                	<li><a >总条数：{{count}}</a></li>
					<li><a >总页数：{{totalPage}}</a></li>
                    <li><a ng-click="changePage(1)">首页</a></li>
                    <li><a ng-show="currentPage>1" ng-click="changePage(currentPage-1)"><i class="fa fa-chevron-left"></i></a></li>
                    <li ng-repeat="item in pageList" ng-click="changePage(item.number)" class="{{item.active}}"><a>{{item.number}}</a></li>
                    <li><a ng-show="currentPage<totalPage" ng-click="changePage(currentPage+1)"><i class="fa fa-chevron-right"></i></a></li>
                    <li><a ng-click="changePage(totalPage)">尾页</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>

<div class="md-overlay"></div>

<script src="../default/js/modernizr.custom.js"></script>
<script src="../default/js/classie.js"></script>
<script src="../default/js/modalEffects.js"></script>
<script type="text/javascript">
    function init() {
        var overlay = document.querySelector('.md-overlay');
        [].slice.call(document.querySelectorAll('.md-trigger')).forEach(function (el, i) {
            var modal = document.querySelector('#' + el.getAttribute('data-modal')),
                    close = modal.querySelector('.md-close');

            function removeModal(hasPerspective) {
                classie.remove(modal, 'md-show');
                if (hasPerspective) {
                    classie.remove(document.documentElement, 'md-perspective');
                }
            }

            function removeModalHandler() {
                removeModal(classie.has(el, 'md-setperspective'));
            }

            el.addEventListener('click', function (ev) {
                classie.add(modal, 'md-show');
                overlay.removeEventListener('click', removeModalHandler);
                overlay.addEventListener('click', removeModalHandler);
                if (classie.has(el, 'md-setperspective')) {
                    setTimeout(function () {
                        classie.add(document.documentElement, 'md-perspective');
                    }, 25);
                }
            });
            close.addEventListener('click', function (ev) {
                ev.stopPropagation();
                removeModalHandler();
            });
            $(document).keyup(function (e) {
                if (e.keyCode == 27) {
                    e.stopPropagation();
                    removeModalHandler();
                }
            });
        });
    }
    function closeMod() {
        $(".md-close").click();
    }
    $(document).ready(function () {
        init();
    });
    $("#uploadbutton").click(function () {
        var filename = $("#upfile").val();
        var formData = new FormData($('form')[0]);
        $.ajax({
            type: "POST",
            url: WEB_URL + "/servant/servant/uploadFile",
            enctype: 'multipart/form-data',
            data: formData,
            processData: false,
            contentType: false,
            dataType: 'json',
            success: function (json) {
                if (json.status) {
                    $('#filepath').val(json.path);
                    alert(json.description);
                }
                else {
                    alert(json.description);
                }
            }
        });
    });
</script>